using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Design;
using dialogs = Sixeyed.CacheAdapter.Management.Dialogs;
using System.Windows.Forms.Design;
using System.ComponentModel;
using System.Windows.Forms;
using Sixeyed.CacheAdapter.Interfaces;
using Sixeyed.CacheAdapter.Management.UITypeEditors.Bases;

namespace Sixeyed.CacheAdapter.Management.UITypeEditors
{
    /// <summary>
    /// UITypeEditor for cache provider type name setting
    /// </summary>
    public class CacheProviderTypeName : CacheProviderEditorBase<dialogs.CacheProviderTypeName>
    {
        /// <summary>
        /// Returns the provider name from the static <see cref="TransmitLocation"/> instance
        /// </summary>
        /// <returns>Provider type name string</returns>
        protected override object GetValue()
        {
            return TransmitLocation.Current.Provider;
        }

        /// <summary>
        /// Sets the provider name on the static <see cref="TransmitLocation"/> instance
        /// </summary>
        /// <param name="value">Provider type name string</param>
        protected override void SetValue(object value)
        {
            TransmitLocation.Current.Provider = (string)value;
        }
    }
}
